<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class InitUserGroup extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_groups', function (Blueprint $table) {
            $table->comment = '用户分组表';
            
            $table->increments('id');
            $table->uuid('uuid')->index() ;

            $table->string('title', 20)->comment('标题，只显示在管理后台');

            // $table->string('display_title', 20)->comment('分组标题，会显示在小程序端中');

            $table->json('options')->nullable()->comment('筛选条件');

            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::disableForeignKeyConstraints();
        Schema::dropIfExists('user_groups');
    }
}
